package com.mc2.docapp.disabilityassessmenttool.Misc;

import com.mc2.docapp.disabilityassessmenttool.AmputationAdditionalPoints;
import com.mc2.docapp.disabilityassessmenttool.AmputationLowerLimb;
import com.mc2.docapp.disabilityassessmenttool.AmputationUpperLimb;
import com.mc2.docapp.disabilityassessmenttool.CerebralPalsy;
import com.mc2.docapp.disabilityassessmenttool.CongenitalDeficiencies;
import com.mc2.docapp.disabilityassessmenttool.Dwarfism;
import com.mc2.docapp.disabilityassessmenttool.ExtPointsScoliosis;
import com.mc2.docapp.disabilityassessmenttool.FinalCalculation;
import com.mc2.docapp.disabilityassessmenttool.Kyphosis;
import com.mc2.docapp.disabilityassessmenttool.LowLimCombMobStabExtPoints;
import com.mc2.docapp.disabilityassessmenttool.LowLimbMobilityComponent;
import com.mc2.docapp.disabilityassessmenttool.LowLimbMusclePower;
import com.mc2.docapp.disabilityassessmenttool.LowrLmbActiveRom;
import com.mc2.docapp.disabilityassessmenttool.MiscMedConditions;
import com.mc2.docapp.disabilityassessmenttool.MoreExtPointsScoliosis;
import com.mc2.docapp.disabilityassessmenttool.NeuroDeficit;
import com.mc2.docapp.disabilityassessmenttool.NewPatient;
import com.mc2.docapp.disabilityassessmenttool.SpinlAffnScoliosis;
import com.mc2.docapp.disabilityassessmenttool.SpinlAffnTraumtaicAffn;
import com.mc2.docapp.disabilityassessmenttool.UpLimbAcRom;
import com.mc2.docapp.disabilityassessmenttool.UpLimbAdditionalWgtage;
import com.mc2.docapp.disabilityassessmenttool.UpLimbCoActivities;
import com.mc2.docapp.disabilityassessmenttool.UpLimbMusclePower;
import com.mc2.docapp.disabilityassessmenttool.UpperLmbHandComponent;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

class AffectedBodyParts {
    //    public static Map<String, Class> routingMap = new LinkedHashMap<>();
    public static Map<String, List<Class>> routingMap = new LinkedHashMap<>();

    public AffectedBodyParts() {
//        this.routingMap.put("1", UpLimbAcRom.class);
//        this.routingMap.put("Rt.Upper Limb", UpLimbAcRom.class);
//        this.routingMap.put("Lt.Upper Limb", UpLimbAcRom.class);
//        List<Class> jj = Arrays.asList(new Class[]{UpLimbAcRom.class,UpLimbMusclePower.class});
//        this.routingMap.put("2", UpLimbMusclePower.class);
//        this.routingMap.put("3", UpLimbCoActivities.class);
//        this.routingMap.put("4", UpLimbCoActivities.class);
//        this.routingMap.put("5", UpLimbAdditionalWgtage.class);
//        this.routingMap.put("6", LowrLmbActiveRom.class);
//        this.routingMap.put("Rt.Lower Limb", LowrLmbActiveRom.class);
//        this.routingMap.put("Lt.Lower Limb", LowrLmbActiveRom.class);

//        this.routingMap.put("7", LowLimbMusclePower.class);
//        this.routingMap.put("8", LowLimbMobilityComponent.class);
//        this.routingMap.put("9", LowLimCombMobStabExtPoints.class);
//        this.routingMap.put("10", AmputationUpperLimb.class);
//        this.routingMap.put("Amputation", AmputationUpperLimb.class,AmputationLowerLimb.class,AmputationAdditionalPoints.class);
//        this.routingMap.put("11", AmputationLowerLimb.class);
//        this.routingMap.put("12", AmputationAdditionalPoints.class);
//        this.routingMap.put("13", Dwarfism.class);
        this.routingMap.put("NewPatient", Arrays.asList(new Class[]{NewPatient.class}));
        this.routingMap.put("Rt.Upper Limb", Arrays.asList(new Class[]{UpLimbAcRom.class, UpLimbMusclePower.class, UpLimbCoActivities.class, UpperLmbHandComponent.class, UpLimbAdditionalWgtage.class}));
        this.routingMap.put("Lt.Upper Limb", Arrays.asList(new Class[]{UpLimbAcRom.class, UpLimbMusclePower.class, UpLimbCoActivities.class, UpperLmbHandComponent.class,  UpLimbAdditionalWgtage.class}));
        this.routingMap.put("Rt.Lower Limb", Arrays.asList(new Class[]{LowrLmbActiveRom.class, LowrLmbActiveRom.class, LowLimbMusclePower.class,
                LowLimbMobilityComponent.class, LowLimCombMobStabExtPoints.class}));
        this.routingMap.put("Lt.Lower Limb", Arrays.asList(new Class[]{LowrLmbActiveRom.class, LowrLmbActiveRom.class, LowLimbMusclePower.class,
                LowLimbMobilityComponent.class, LowLimCombMobStabExtPoints.class}));


        this.routingMap.put("Amputation", Arrays.asList(new Class[]{AmputationUpperLimb.class, AmputationLowerLimb.class, AmputationAdditionalPoints.class}));

        this.routingMap.put("Dwarfism", Arrays.asList(new Class[]{Dwarfism.class}));
        this.routingMap.put("Congenital Deformity", Arrays.asList(new Class[]{CongenitalDeficiencies.class}));
        this.routingMap.put("Spine/Neurological", Arrays.asList(new Class[]{SpinlAffnTraumtaicAffn.class, SpinlAffnScoliosis.class, ExtPointsScoliosis.class, MoreExtPointsScoliosis.class,Kyphosis.class,
                MiscMedConditions.class, NeuroDeficit.class}));
       /* this.routingMap.put("16", Arrays.asList(new Class[]{}));
        this.routingMap.put("17", Arrays.asList(new Class[]{ExtPointsScoliosis.class}));
        this.routingMap.put("18", Arrays.asList(new Class[]{}));
        this.routingMap.put("19", Arrays.asList(new Class[]{}));
        this.routingMap.put("20", Arrays.asList(new Class[]{}));
        this.routingMap.put("21", Arrays.asList(new Class[]{}));*/
        this.routingMap.put("Cerebral Palsy", Arrays.asList(new Class[]{CerebralPalsy.class}));
        this.routingMap.put("23", Arrays.asList(new Class[]{FinalCalculation.class}));

    }

    public void parts() {
        this.routingMap.put("NewPatient", Arrays.asList(new Class[]{NewPatient.class}));
        this.routingMap.put("Rt.Upper Limb", Arrays.asList(new Class[]{UpLimbAcRom.class, UpLimbMusclePower.class, UpLimbMusclePower.class, UpLimbCoActivities.class
                , UpLimbCoActivities.class, UpLimbAdditionalWgtage.class}));
        this.routingMap.put("Lt.Upper Limb", Arrays.asList(new Class[]{UpLimbAcRom.class, UpLimbMusclePower.class, UpLimbMusclePower.class, UpLimbCoActivities.class
                , UpLimbCoActivities.class, UpLimbAdditionalWgtage.class}));
        this.routingMap.put("Rt.Lower Limb", Arrays.asList(new Class[]{LowrLmbActiveRom.class, LowrLmbActiveRom.class, LowLimbMusclePower.class,
                LowLimbMobilityComponent.class, LowLimCombMobStabExtPoints.class}));
        this.routingMap.put("Lt.Lower Limb", Arrays.asList(new Class[]{LowrLmbActiveRom.class, LowrLmbActiveRom.class, LowLimbMusclePower.class,
                LowLimbMobilityComponent.class, LowLimCombMobStabExtPoints.class}));


        this.routingMap.put("Amputation", Arrays.asList(new Class[]{AmputationUpperLimb.class, AmputationLowerLimb.class, AmputationAdditionalPoints.class}));

        this.routingMap.put("Dwarfism", Arrays.asList(new Class[]{Dwarfism.class}));
        this.routingMap.put("Congenital Deformity", Arrays.asList(new Class[]{CongenitalDeficiencies.class}));
        this.routingMap.put("Spine/Neurological", Arrays.asList(new Class[]{SpinlAffnTraumtaicAffn.class}));
        this.routingMap.put("16", Arrays.asList(new Class[]{SpinlAffnScoliosis.class}));
        this.routingMap.put("17", Arrays.asList(new Class[]{ExtPointsScoliosis.class}));
        this.routingMap.put("18", Arrays.asList(new Class[]{MoreExtPointsScoliosis.class}));
        this.routingMap.put("19", Arrays.asList(new Class[]{Kyphosis.class}));
        this.routingMap.put("20", Arrays.asList(new Class[]{MiscMedConditions.class}));
        this.routingMap.put("21", Arrays.asList(new Class[]{NeuroDeficit.class}));
        this.routingMap.put("Cerebral Palsy", Arrays.asList(new Class[]{CerebralPalsy.class}));
        this.routingMap.put("23", Arrays.asList(new Class[]{FinalCalculation.class}));
    }

    public Map<String, List<Class>> strip(String[] removeThese) {
        for (int i = 0; i < removeThese.length; i++) {
            this.routingMap.remove(removeThese[i]);
        }
        /*for (int i = 0; i < removeThese.length; i++) {
            if (removeThese[i] != null) {


                if (removeThese[i].equalsIgnoreCase("Rt.Upper Limb") || removeThese[i].equalsIgnoreCase("Lt.Upper Limb")) {
                    this.routingMap.remove("Rt.Upper Limb");
                    this.routingMap.remove("Lt.Upper Limb");
                }
                if (removeThese[i].equalsIgnoreCase("Rt.Lower Limb") || removeThese[i].equalsIgnoreCase("Lt.Lower Limb")) {
                    this.routingMap.remove("Rt.Lower Limb");
                    this.routingMap.remove("Lt.Lower Limb");
                }
            }
        }*/
        return this.routingMap;
    }
}